/*
 * @Author: 清香白莲 1243327527@qq.com
 * @Date: 2023-09-12 15:22:05
 * @LastEditors: 清香白莲 1243327527@qq.com
 * @LastEditTime: 2023-09-20 17:33:22
 * @FilePath: /shang_study/src/router/routes.js
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
import Home from '@/pages/Home'
import Search from '@/pages/Search'
import Login from '@/pages/Login'
import Register from '@/pages/Register'
import Detail from '@/pages/Detail'
import AddCartSuccess from '@/pages/AddCartSuccess'
import ShopCart from '@/pages/ShopCart'

export default [
    {//这是进行重定向
        path: '*',
        redirect: "/home",
    },
    {
        path: '/home',
        component: Home,
        meta:{
            show: true,
        }
    },
    {
        name: 'search',
        path: '/search/:keyword?',
        component: Search,
        meta:{
            show: true,
        }
    },
    {
        path: '/login',
        component: Login,
        meta:{
            show: false,
        }
    },
    {
        path: '/register',
        component: Register,
        meta:{
            show: false,
        }
    },
    {
        name: 'detail',
        //query传参
        path: '/detail/:skuId?',
        component: Detail,
        meta:{
            show: true,
        }
    },
    {
        name: 'addcartsuccess',
        path: '/addcartsuccess/:skuNum?',
        component: AddCartSuccess,
        meta:{
            show: true,
        }
    },
    {
        name: 'shopcart',
        path: '/ShopCart',
        component: ShopCart,
        meta:{
            show: true,
        }
    },
]